﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Downloader.Domain;
using Downloader.Domain.Contracts.Tasks;
using SharpArch.Domain.PersistenceSupport;

namespace Downloader.Tasks
{
  public   class CommentTasks:ICommentTasks
    {
      public IRepository<Comment> CommentRepository { get; set; }
        public List<Domain.Comment> GetAll()
        {
            return CommentRepository.GetAll().ToList();
        }

        public Domain.Comment Get(int id)
        {
            return CommentRepository.Get(id);
        }

        public Domain.Comment CreateOrUpdate(Domain.Comment category)
        {
            return CommentRepository.SaveOrUpdate(category);
        }

        public void Delete(int id)
        {
            var t = CommentRepository.Get(id);
            CommentRepository.Delete(t);
        }
    }
}
